﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.ApplicationBlocks.Data;
using System.Data;
using System.Data.SqlClient;

namespace MyTemplate
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string enteredUname = txtUserID.Text.Trim();
            string enteredPW = txtPW.Text.Trim();
            User user = new User();
            if ( user.GetUserByIdFromUserName(enteredUname, enteredPW) >= 0 )
            {
                lblResult.Text = "환영합니다.";
                Panel1.Visible = false;
                btnLogout.Visible = true;
            }
            else
            {
                lblResult.Text = "잘못 입력하셨습니다.";
            }
        }

        protected void btnLogout_Click(object sender, EventArgs e)
        {
            Panel1.Visible = true;
            btnLogout.Visible = false;
        }
    }
}